const path = require('path')
const pageConfig = require('./pageConfig.js')
function resolve(dir) {
  return path.join(__dirname, dir)
}
module.exports = {
  lintOnSave: false,
  pages: pageConfig,
  chainWebpack: (config) => {
    config.resolve.alias
      .set('@', resolve('src'))
      .set('assets', resolve('src/assets'))
      .set('components', resolve('src/components'))
      .set('layout', resolve('src/layout'))
      .set('base', resolve('src/base'))
      .set('static', resolve('src/static'))
  },
  configureWebpack: {
    devServer: {
      historyApiFallback: {
        verbose: true,
        rewrites: [
          { from: /^\/site\/.*$/, to: '/site.html' },
          { from: /^\/message\/.*$/, to: '/message.html' },
          { from: /^\/my\/.*$/, to: '/my.html' },
          { from: /^\/myInfo\/.*$/, to: '/myInfo.html' },
        ],
      },
    },
  },
}
